<template>
	<view class="content">
		<view class="ipts">
			<view class="info-item">
				<view class="info-item-left">
					<image src="/static/phone.png" mode=""></image>
					<view class="shuxian"></view>
				</view>
				<input type="text" v-model="username" placeholder="请输入户主姓名" placeholder-class="place-class">
			</view>
			<view class="hengxian"></view>
		<view class="info-item">
			<view class="info-item-left">
				<image src="/static/phone.png" mode=""></image>
				<view class="shuxian"></view>
			</view>
			<input type="idcard" v-model="myid" placeholder="请输入户主身份证号" placeholder-class="place-class">
		</view>
			<view class="hengxian"></view>
			<view class="info-item">
				<view class="info-item-left">
					<image src="/static/phone.png" mode=""></image>
					<view class="shuxian"></view>
				</view>
				<input type="number" v-model="pswd" placeholder="请输入新手机号" placeholder-class="place-class">
			</view>
			 
		</view>
		<view class="btn" @click="subimit">确定更改</view>
		<!-- <u-button type="primary" class="btn" @click="subimit" >确定</u-button> -->
	</view>
</template>

<script> 
	export default { 
		data() {
			return {
				username: '',
				myid: '',
				pswd:''
			};
		},
		onLoad() { 
			// this.getInstallDetail()
		},
		onShow() {
			// uni.getStorage({
			// 	key:'logininfo',
			// 	success:(res)=>{},
			// 	fail() {
			// 		uni.redirectTo({
			// 			url: '../../login/login'
			// 		})
			// 	}
			// })
		},
		//下拉刷新
		onPullDownRefresh(){
			this.page=1
			 setTimeout(function() {
			 	uni.stopPullDownRefresh();
			 }, 500);
			this.getInstallDetail()
		},
		onReachBottom() {
			this.page++
			this.getInstallDetail()
		},
		methods: {
			subimit() {
				let that = this
				if(that.username == '') {
					uni.showToast({
						title: '请输入用户姓名',
						icon: 'none'
					})
					return
				}
				if(that.myid == '') {
					uni.showToast({
						title: '请输入您的身份证',
						icon: 'none'
					})
					return
				}
				if(that.pswd == '') {
					uni.showToast({
						title: '请输入新手机号',
						icon: 'none'
					})
					return
				}
				this.$u.post('common/resetmobile', {
					user_name: that.username,
					id_car: that.myid,
					newmobile: that.pswd,
					type:0
				}).then(res => {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					if(res.code == 1) {
						setTimeout(()=>{
							uni.navigateBack({
								delta:1
							})
						},1000)
					}
				})
			}
		},
		
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #F5F5F5;
		// padding-bottom: 200rpx;
		// margin-bottom: 150rpx;
	}
	.content{
		padding-bottom: 140rpx;
	}
	.ipts{
		background-color: #fff;
		margin-top: 30rpx;
	}
	.info-item{
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 100rpx;
		width: 100%;
		padding: 0 30rpx;
		background-color: #fff;
		font-size: 32rpx;
		color: #333;
		input{
			flex: 1;
			text-align: left;
		}
		.info-item-left{
			display: flex;
			width: 10%;
			image{
				width: 32rpx;
				height: 32rpx;
				margin-right: 8rpx;
			}
			.shuxian{
				width: 2rpx;
				height: 32rpx;
				background: #dddddd;
				border-radius: 2rpx;
			}
		}
	}
	.hengxian{
		width: 700rpx;
		height: 2rpx;
		background-color:  #dddddd;
		margin: 0 auto;
	}
	.place-class{
		font-size: 28rpx;
		color: #999;
	}
	.btn{
		width: 646rpx;
		height: 80rpx;
		margin: 74rpx auto;
		text-align: center;
		line-height: 80rpx;
		border-radius: 10rpx;
		background-image: linear-gradient(to bottom, #2979ff, #2979ff);
		font-size: 32rpx;
		color: #E5EFFE;
	}
	.btn:active{
		background: rgba(0,0,0,0.4);
	}
	.test-code{
		padding: 10rpx 10rpx;
		font-size: 24rpx;
		color: #003690;
		border: 2rpx solid #003690;
		border-radius: 8rpx;
	}
	.test-code:active{
		background: rgba(69, 82, 202, 0.4);
		color: #fff;
	}
</style>
